﻿
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>支付方式</title>
	<meta name="viewport" content="initial-scale=1, maximum-scale=1">
	<link rel="shortcut icon" href="/favicon.ico">
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">

	<link rel="stylesheet" href="css/animation.css">
	<link rel="stylesheet" href="css/light7.min.css">
	<link rel="stylesheet" href="css/light7-swipeout.css">
	<link rel="stylesheet" href="css/light7-swiper.min.css">

	<link rel="stylesheet" href="css/wap_style.css">

</head>
<body>
<div class="page" id="receipt_view">
	<header class="bar bar-nav l-white">
		<a class="icon pull-left return-icon back" href="{:url('payment_term')}">
			<img src="picture/return_gray.png" width="100%">
		</a>
		<h1 class="title"><span>支付方式</span></h1>
	</header>

	<div class="content transfer-content">
		<div class="transfer-box">
			<form class="layui-form up-down" onsubmit="return false">
				<input type="hidden" value="UserPayment.DoInfo" name="s"/>
				<input type="hidden" value="deal/Index/addterm" name="root"/>
				<div class="list-block">
					<ul>
						<li>
							<div class="item-content">
								<div class="item-title">支付方式</div>
								<div class="item-input select">
									<input type="text" readonly lay-picker="" lay-filter="change_receipt" data-data=''  class="receipt" data-title="支付方式" value=""/>
									<input type="hidden" value="0" name="key" />
									<input type="hidden" value="" name="receipttype_id" />
								</div>
							</div>
						</li>
						<li class="name">
							<div class="item-content">
								<div class="item-title">姓名</div>
								<div class="item-input">
									<input type="text" name="realname" autocomplete="off" lay-verify="required"
										   placeholder="请输入姓名">
								</div>
							</div>
						</li>
					</ul>
				</div>
				<button class="click-btn" lay-submit lay-filter="BackRefreshForm">确认</button>
			</form>
		</div>
	</div>
	<script type="text/html" id="receipt_view_tpl">
		{{#js_compare "this.filed_type=='0'"}}
		<li>
			<div class="item-content">
				<div class="item-title">开户银行</div>
				<div class="item-input">
					<input type="text" name="bankname" autocomplete="off" lay-verify="required"
						   placeholder="请输入开户银行">
				</div>
			</div>
		</li>
		<li>
			<div class="item-content">
				<div class="item-title">开户支行</div>
				<div class="item-input">
					<input type="text" name="bankbranch" autocomplete="off" lay-verify="required"
						   placeholder="请输入开户支行">
				</div>
			</div>
		</li>
		<li>
			<div class="item-content">
				<div class="item-title">银行卡账号</div>
				<div class="item-input">
					<input type="text" name="account" autocomplete="off" lay-verify="required"
						   placeholder="请输入银行卡账号">
				</div>
			</div>
		</li>
		{{/js_compare}}
		{{#js_compare "this.filed_type==1"}}
		<li>
			<div class="item-content">
				<div class="item-title">{{payment}}账号</div>
				<div class="item-input">
					<input type="text" name="account" autocomplete="off" lay-verify="required"
						   placeholder="请输入{{payment}}账号">
				</div>
			</div>
		</li>
		<li>
			<div class="item-content">
				<div class="item-title">{{payment}}二维码</div>
				<div class="item-input">
					<img src="picture/upload.png" class="upload">
					<input name="qrcode" value="" class="upload_file" type="hidden" lay-verify="required"/>
				</div>
			</div>
		</li>
		{{/js_compare}}
		{{#js_compare "this.filed_type==2"}}
		<li>
			<div class="item-content">
				<div class="item-title">{{payment}}账号</div>
				<div class="item-input">
					<input type="text" name="account" autocomplete="off" lay-verify="required" placeholder="请输入{{payment}}账号">
				</div>
			</div>
		</li>

		{{/js_compare}}

	</script>
	<script type="text/javascript">
	var base_url = 'http://www.jiaoyi.com/',sellid=0,off_on= true;
</script>
	<script type='text/javascript' src='js/jquery-3.3.1.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/light7.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/light7-swiper.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/light7-swipeout.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/cn.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/layui.js' charset='utf-8'></script>
	<script type='text/javascript' src='js/basis.js' charset='utf-8'></script>
	<script type="text/javascript">
		$(function(){
			var payment;
			var basis = layui.basis
			payment = '[{"id":"5","name":"银行转账","short":"bank","filed_type":"0"},{"id":"4","name":"现金存款","short":"cash","filed_type":"2"},{"id":"3","name":"以太坊","short":"eth","filed_type":"1"},{"id":"2","name":"支付宝支付","short":"alipay","filed_type":"1"},{"id":"1","name":"微信支付","short":"wechat","filed_type":"1"}]';
			payment =JSON.parse(payment)
			var picker = {};
			var pickers = [];
			for (var k in payment) {
				picker[k] = payment[k]['name'];
				pickers.push(payment[k]['id']);
			}
			$('input[name=receipttype_id]').val(payment[0]['id'])
			$('#receipt_view .name').after($.t7.compile($('#receipt_view_tpl').html())({
			   filed_type: payment[0]['filed_type'],
				'payment': '银行转账'
			}));
			basis.refreshPicker('#receipt_view .receipt', picker,pickers);
			basis.picker('change_receipt', function (d) {
				console.log(d)
				$('#receipt_view .name').nextAll().remove();
				$('#receipt_view .name').after($.t7.compile($('#receipt_view_tpl').html())({
					filed_type: payment[d.data.key]['filed_type'],
					'payment': d.data.value
				}));
				var $elem = $('#receipt_view .upload')
				/*basis.upload({
					elem: $elem,
					field: 'proimg',
					data: {
						s: 'Default.UploadImage',
					},
					root: 'user/upload/dofile'
				}, function (d) {
					$elem.attr('src', d.img_domain+d.imgurl);
					$('#receipt_view .upload_file').val(d.imgurl);
					//$elem.parent().html('<span  style="color: red">待审核</span>')
				});*/
			});
		})
	   /* layui.loadPage({
			receipt_view: function (id) {
				var basis = this.basis(), $this = this;
				var payment;
				$this.sendAjax({s: 'UserPayment.GetIncomeList', root: 'wallet/c2c/receipt/types'}, function (d) {
					payment = d;
					var picker = {};
					var pickers = [];
					for (var k in payment) {
						picker[k] = payment[k]['name'];
						pickers.push(payment[k]['id']);
					}

					$('input[name=receipttype_id]').val(payment[0]['id'])

					basis.refreshPicker('#receipt_view .receipt', picker,pickers);
				})

				basis.picker('change_receipt', function (d) {
					$('#receipt_view .name').nextAll().remove();
					$('#receipt_view .name').after($.t7.compile($('#receipt_view_tpl').html())({
						filed_type: payment[d.data.key]['filed_type'],
						'payment': d.data.value
					}));
					var $elem = $('#receipt_view .upload')
					$this.upload({
						elem: $elem,
						field: 'proimg',
						data: {
							s: 'Default.UploadImage',
						},
						root: 'user/upload/dofile'
					}, function (d) {
						$elem.attr('src', d.img_domain+d.imgurl);
						$('#receipt_view .upload_file').val(d.imgurl);
						//$elem.parent().html('<span  style="color: red">待审核</span>')
					});

				});

			}
		})*/
	</script>
</div>




</body>
</html>
